1. Technical Field
The present invention relates in general to threads and, in particular to, techniques for executing threads in a computing environment.
2. Description of the Related Art
The term ‘utility computing’ has been used to refer to a computational model in which processing, storage and network resources, software, and data are accessible to client computer systems and other client devices (e.g., mobile phones or media players) on demand, much like familiar residential utility services, such as water and electricity. In some implementations, the specific computational resources (e.g., servers, storage drives, etc.) allocated for access and use by client devices are specified by service agreements between the utility computing provider and its customers. In other implementations, commonly referred to as “cloud computing,” details of the underlying information technology (IT) infrastructure are transparent to the utility computing customers.
Cloud computing is facilitated by ease-of-access to remote computing websites (e.g., via the Internet or a private corporate network) and frequently takes the form of web-based resources, tools, or applications that a cloud consumer can access and use through a web browser, as if the resources, tools, or applications were a local program installed on a computer system of the cloud consumer. Commercial cloud implementations are generally expected to meet quality of service (QoS) requirements of cloud consumers, which may be specified in service level agreements (SLAs). In a typical cloud implementation, cloud consumers consume computational resources as a service and pay only for the resources used.
Adoption of utility computing has been facilitated by the widespread utilization of virtualization, which is the creation of virtual (rather than actual) versions of computing resources, e.g., an operating system, a server, a storage device, network resources, etc. For example, a virtual machine (VM), also referred to as a logical partition (LPAR), is a software implementation of a physical machine (e.g., a computer system) that executes instructions like a physical machine. VMs can be categorized as system VMs or process VMs. A system VM provides a complete system platform that supports the execution of a complete operating system (OS), such as Windows, Linux, AIX, Android, etc., as well as its associated applications. A process VM, on the other hand, is usually designed to run a single program and support a single process. In either case, any application software running on the VM is limited to the resources and abstractions provided by that VM. Consequently, the actual resources provided by a common IT infrastructure can be efficiently managed and utilized through the deployment of multiple VMs, possibly associated with multiple different utility computing customers.
The virtualization of actual IT resources and management of VMs is typically provided by software referred to as a VM monitor (VMM) or hypervisor. In various implementations, a VMM may run on bare hardware (Type 1 or native VMM) or on top of an operating system (Type 2 or hosted VMM).
In a typical virtualized computing environment, VMs can communicate with each other and with physical entities in the IT infrastructure of the utility computing environment utilizing conventional networking protocols. As is known in the art, conventional networking protocols are commonly premised on the well known seven layer Open Systems Interconnection (OSI) model, which includes (in ascending order) physical, data link, network, transport, session, presentation, and application layers. VMs are enabled to communicate with other network entities as if the VMs were physical network elements through the substitution of a virtual network connection for the conventional physical layer connection.
The UNIX® operating system (OS) was designed to be a portable, multi-tasking, and multi-user OS. UNIX is characterized by: the use of plain text for storing data; a hierarchical file system; treating devices and certain types of inter-process communications (IPCs) as files; and the use of a large number of software tools. UNIX includes various utilities along with a master control program, i.e., the UNIX kernel. The UNIX kernel provides services to start and stop programs, handles the file system and other common low-level tasks that most programs share, and schedules access to hardware to avoid conflicts if multiple programs try to access the same resource or device simultaneously. Because of the acknowledged security, portability and functionality of UNIX, a large number of similar operating system have been developed, including Linux™, Minix™, Mac OS™, FreeBSD™, NetBSD™, OpenBSD™, AIX™, Solaris™, and HP/UX™. All of these operating systems, together with UNIX, are referred to herein as “Unix-like” OSs. Unix-like OSs can be installed on a wide variety of hardware, e.g., mobile phones, tablet computers, video game consoles, networking gear, mainframes, and supercomputers.
In computer science, a thread of execution (thread) is usually the smallest unit of processing that can be scheduled by an OS. A thread generally results from a fork of a computer program into two or more concurrently running tasks. The implementation of threads and processes may differ between OSs, but in most cases a thread is included within a process. Multiple threads can exist within the same process and share resources (e.g., memory), while different processes do not share the same resources. On a single processor system, multi-threading is implemented through time-division multiplexing (i.e., a processor switches between executing different threads). On a multi-processor or multi-core system, multiple threads may run at the same time on different processors or processor cores. Many modern OSs directly support both time-sliced and multi-processor threading with a process scheduler. The kernel of an OS allows programmers to manipulate threads via a system call interface.
Portable operating system interface for UNIX (POSIX) is the name of a family of related standards that define an application programming interface (API), along with shell and utilities interfaces, for software compatible with Unix-like OSs. POSIX threads (pthreads) refer to threads that are compliant with the POSIX standard for threads (i.e., POSIX.1c (IEEE 1003.1c-1995), which defines an API for creating and manipulating threads). Implementations of the POSIX API are available on many Unix-like POSIX-conformant OSs, e.g., FreeBSD™, NetBSD™, GNU/Linux™, Mac OS X™, and Solaris™.